package com.yyl.controller;

import com.yyl.entity.Dept;
import com.yyl.service.IDeptService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("dept")
public class DeptController {
    @Resource
    private IDeptService deptService;
    @GetMapping
    public List<Dept> findAll(){
        return deptService.deptList();
    }
    // 添加  dept
    @PostMapping
    public int addDept(Dept dept){
        return deptService.addDept(dept);
    }
    @PutMapping
    public int updDept(Dept dept){
        return deptService.updDept(dept);
    }
    @DeleteMapping
    public int delDept(int id){
        return deptService.del(id);
    }
}
